package com.wc;

public class RefTest {

    public static void main(String[] args) {
        Person person = new Person();
        person.name = "zs";
        person.age = 10;

        new TestThread(person).start();


        person.name = "ls";
        person.age = 20;

        System.out.println(person);

    }

}


class TestThread extends Thread {
    Person person;

    public TestThread(Person person) {
        this.person = person;
    }

    @Override
    public void run() {
        // sleep
        try {
            Thread.sleep(100);
            System.out.println(person);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
}